package cn.getech.data.development.entity.permission;

import cn.getech.data.development.entity.TableInfo;
import lombok.Data;

import java.util.List;

/**
 * @description: 数据仓库表数据权限实体
 * @author: wangzhaowen：kiss
 * @create: 2020/7/31 14:26
 * @version: 2020/7/31
 **/
@Data
public class TenantTableInfoPermission extends SysTenantDataPermission {



   /**
    * 表名称
    */
   private String chName;

   /**
    * 英文名称
    */
   private String enName;


   private List<TenantTableFieldInfoPermission> tableFieldInfos;

    /**
     * 表密级信息
     */
    private String levelName;

    public TenantTableInfoPermission( ) {
    }

    public TenantTableInfoPermission(TableInfo record, SysTenantDataPermission sysTenantDataPermission) {
        if (record != null) {
            setEnName(record.getTableName());
            setChName(record.getTableAlias());
            setLevelName(record.getLevelName());
            setDataId(record.getId());
        }
        if (sysTenantDataPermission != null) {
            setQuery(sysTenantDataPermission.getQuery());
            setCreate(sysTenantDataPermission.getCreate());
            setUpdate(sysTenantDataPermission.getUpdate());
            setDelete(sysTenantDataPermission.getDelete());
            setAssign(sysTenantDataPermission.getAssign());
            setDecrypt(sysTenantDataPermission.getDecrypt());
            setExport(sysTenantDataPermission.getExport());
            setTenantId(sysTenantDataPermission.getTenantId());
            setDataType(sysTenantDataPermission.getDataType());
            setId(sysTenantDataPermission.getId());
            setWrite(sysTenantDataPermission.getWrite());
        }
    }


}
